﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ARS.PublicTool.FormsHelper
{
    public class ControlDelegate
    {
        private delegate void ProgressBar_SetValue_Delegate(ProgressBar bar,int value);
        public void ProgressBar_SetValue(ProgressBar bar,int value)
        {
            if (bar.InvokeRequired)
            {
                ProgressBar_SetValue_Delegate set = new ProgressBar_SetValue_Delegate(ProgressBar_SetValue);
                bar.Invoke(set, bar, value);

            }
            else
            {
                bar.Value = value;
            }
        }

    }
}
